<?
global $db;
$release = "`release`";

$e = $db->query1("select * from node where id = ".$db->sqlint($params["id"]));
skin_param("page",$e);
echo "<div>{$e["content"]}</div>";

echo "<p><a href='index.php'>projects</a> | recent releases</p>";

$r = $db->query("select project.title, project.image, project.summary, project.id as pid, $release.id as rid , $release.title as rt, $release.datetimeon as rdt, $release.description as rd from project,$release ".
	" where node_id = ".$db->sqlint($params["id"]). 
	" and project.id = $release.project_id ".
	" order by $release.datetimeon desc ".
	#" limit 12".
	""	); 

inc_inclib("image.php");
global $topdir,$topurl;

echo "<table>";
foreach ($r as $e) {
	echo "<tr>";
	echo "<td valign=top align=center>";
	
	echo "<a href=\"{$e["pid"]}/?release_id={$e["rid"]}\">";
	$fname = "$topdir/shots/{$e["image"]}";
	if ($e["image"] != "" && file_exists($fname)) {
	$img = image_thumb($fname,124,93,"jpg",50);
	list($iw,$ih) = getimagesize("$topdir/thumb/$img");
	echo "<img src='$topurl/thumb/$img' width=$iw height=$ih>";
	} else echo "<img src='$topurl/content/noimage.gif' width=124 height=93>";
	echo "</a>";
	
	echo "<td valign=top>";
	
	echo "<a href=\"{$e["pid"]}/?release_id={$e["rid"]}\">{$e["title"]} - {$e["rt"]}</a>";
	echo " - ". date("M j, Y",strtotime($e["rdt"]));
	echo "<div>{$e["summary"]}</div>";
	
	/*
	if ($e["rd"]) {
		echo "<div>&nbsp;</div>";
		echo "<div><i>Changes:</i> {$e["rd"]}</div>";
		}
	*/
	
	echo "<tr><td>&nbsp;";
	
	}
echo "</table>";

?>